Skip to content

[Vulkan] Add support for MoltenVK on macOS #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

llvm-beanz
Copy link
Collaborator

This gets Vulkan support working on macOS if the Vulkan SDK and MoltenVK are available. All current Vulkan tests except particle_life pass with Vulkan on macOS with DXC, and sign.32.test fails with Clang.

@llvm-beanz llvm-beanz marked this pull request as ready for review June 23, 2025 18:40
@@ -176,6 +176,9 @@ DescriptorSets:
# https://github.com/microsoft/DirectXShaderCompiler/issues/7512
# XFAIL: DXC-Vulkan

# No idea what is going on here, but Out1 and Out3 are coming through as 0's.
# XFAIL: Clang && Vulkan-Darwin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Particle life is probably harder, but this one feel like we should have a follow up task to figure out what is going wrong.

Copy link
Collaborator

@spall spall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@bogner bogner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to link to issues in the XFAILs, but otherwise this looks good.

@llvm-beanz llvm-beanz marked this pull request as draft July 16, 2025 15:19
@llvm-beanz
Copy link
Collaborator Author

I converted this PR to a draft because as much as I would like this to work, it is failing like crazy across a lot of tests right now.

It looks like bugs in the SPIRV->Metal translator as well as MoltenVK doing additional API validation that other drivers don't seem to be doing. I'll revisit this in the future, but for now... it's going to just sit around.

llvm-beanz and others added 5 commits July 20, 2025 10:48
This adds extensions as a queryable capability through the device
interface for Vulkan. This also gates adding extensions that we had
previously been using based on their availabiltiy.

As a last bit, this does include one small line added in the Changes to
enable MoltenVK on Apple. When targeting Apple platforms the
VK_KHR_PORTABILITY is always enabled. That extension is always required
on Apple platforms so we can hard code that one.
This gets Vulkan support working on macOS if the Vulkan SDK and MoltenVK
are available. All current Vulkan tests except particle_life pass with
Vulkan on macOS with DXC, and sign.32.test fails with Clang.
These changes are not actually needed, I just didn't have the linkage and paths correct.
This seems to be working, although it's not great that the library is in
a weird SDK path...
@llvm-beanz llvm-beanz force-pushed the cbieneman/moltenvk branch from 91fd20f to 475d484 Compare July 20, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants